package com.apsfc.controller;

import com.apsfc.po.Admin;
import com.apsfc.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("adminTest")
public class AdminController {
    @Autowired
    @Qualifier("adminService")
    private AdminService adminService;

    @RequestMapping("getAll")
    public String getAll(Model model){      //测试用 获取所有Admin用户密码
        List<Admin> admins = adminService.getAll();
        model.addAttribute("admins",admins);
        System.out.println(admins);
        return "admin/adminList";
    }
}
